package com.yun.algorithmproblem.leetcode;

public class Leetcode167 {
    public int[] twoSum(int[] numbers, int target) {
        int i=0,j= numbers.length-1;
        while (i<j){
            int cur=numbers[i]+numbers[j];
            if(cur>target){
                j--;
            }else if(cur<target){
                i++;
            }else {
                break;
            }
        }
        return new int[]{i+1,j+1};
    }
}
